home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 045a / capstat2.zip / CAPSTAT.SUB < prev   
Text File  |  1991-02-05  |  4KB  |  64 lines

  1.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3.         ':::                                                                 :::
  4.         ':::                                                                 :::
  5.         ':::    PROGRAM:        CAPSTAT.SUB                                  :::
  6.         ':::    AUTHOR:         Mike Shaffer                                 :::
  7.         ':::    DATE:           Feb 2, 1991                                  :::
  8.         ':::    VERSION:        2.0                                          :::
  9.         ':::    PURPOSE:        Determines if printer capture is turned      :::
  10.         ':::                    on for a Novell workstation, and if so,      :::
  11.         ':::                    which device the captured output is being    :::
  12.         ':::                    directed to.                                 :::
  13.         ':::    REVISIONS:                                                   :::
  14.         ':::                                                                 :::
  15.         ':::                                                                 :::
  16.         ':::                                                                 :::
  17.         ':::    NOTES:          This program assumes you're using PDQ from   :::
  18.         ':::                    Crescent Software. If not (shame on you!)    :::
  19.         ':::                    than you can modify the interrupt call to    :::
  20.         ':::                    use INT86 as provided with QuickBASIC, and   :::
  21.         ':::                    take out the reference to PDQDECL.BAS        :::
  22.         ':::                                                                 :::
  23.         ':::                                                                 :::
  24.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  25.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  26.         '
  27.         sub CAPSTAT(capst%,conid%) static
  28.            '
  29.            dim regs as regtype                  ' Create type to hold registers
  30.            '                                    ' NOTE: regtype is defined in
  31.            '                                    '       the PDQ declarations
  32.            '                                    '       include. If you're not
  33.            '                                    '       using PDQ, you'll
  34.            '                                    '       probably want to use
  35.            '                                    '       INT86 as provided by
  36.            '                                    '       QuickBASIC, in which
  37.            '                                    '       case the interrupt
  38.            '                                    '       control structure will
  39.            '                                    '       be an integer array.
  40.            '                                    '       (see the QB docs)
  41.            '                                    '
  42.            '                                    '
  43.            '                                    '
  44.            regs.ax = &hF003                     ' AH=&hF0, AL=&h03
  45.            '                                    '   Function to get cap status
  46.            interrupt &h21,regs                  ' So we get it!
  47.            '                                    '
  48.            temp& = regs.ax                      ' Move to long integer
  49.            if temp&<0 then temp&=temp&+65536    ' Compensate for INT>32767
  50.            al = temp& and &hFF                  ' Get value of AL
  51.            ah = temp&\256                       ' Get value of AH
  52.            if ah = &hFF then                    ' Yes, capture active!
  53.               capst% = -1                       '   Set flag and
  54.               conid% = al                       '   Set connection ID
  55.            else                                 ' ELSE
  56.               capst% = 0                        '   clear flag and
  57.               conid% = 0                        '   clear connection ID
  58.            end if                               '
  59.            '                                    '
  60.         end sub                                 ' Done!
  61.         '
  62.  
  63.  
  64.